from selenium.webdriver.common.by import By
import time
from Base import Base
class Page2(Base):
    # 周考3
    zk3 = (By.XPATH, '//*[@id="app"]/div/section/aside/ul/li[2]/div/span')
    # 登录
    login = (By.XPATH, '/html/body/div/div/section/aside/ul/li[2]/ul/li[2]/a')
    # 用户名
    username = (By.XPATH, '/html/body/div/div/section/section/main/div[1]/div[2]/div[1]/div/input')
    # 密码
    password = (By.XPATH, '/html/body/div/div/section/section/main/div[1]/div[2]/div[2]/div/input')
    # 立即登录
    commit = (By.XPATH, '/html/body/div/div/section/section/main/div[1]/div[2]/button[2]')
    userlogin = (By.XPATH, '/html/body/div/div/section/section/main/div[1]/div[1]/span')
    # 登录用户业务
    def registeryewu(self,username,password):
        self.get_url('http://localhost:8082/')
        time.sleep(2)
        # self.click(self.zk3)
        time.sleep(2)
        self.click(self.login)
        time.sleep(2)
        # 输入用户名
        self.send_keys(self.username,username)
        time.sleep(2)
        self.send_keys(self.password,password)
        time.sleep(2)
        # 提交
    def login_a(self):
        self.click(self.commit)